package com.taotao.portal.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.taotao.pojo.Item;
import com.taotao.portal.service.ItemService;
@RequestMapping(value="order")
@Controller
public class OrderController {

	@Autowired
	private ItemService itemService;
	
	@RequestMapping(value="{itemId}",method=RequestMethod.GET)
	public ModelAndView showOrderPage(@PathVariable("itemId")Long itemId){
		ModelAndView mv = new ModelAndView("order");
		Item item = itemService.queryItemById(itemId);
		mv.addObject("item", item);
		return mv;
	}
}
